home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
NULLIFY.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
3KB
|
74 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_Nullify( cFunctionRetVal, cRetType ) --> xValue
PARAMETERS:
cFunctionRetVal: The function call, with parameters, to execute
cRetType : Return Value type.
SHORT:
Nullify an expression of any type in-line.
DESCRIPTION:
_Nullify() accepts a function call as it's first parameter, and returns
an empty value of the type specified in cRetType.
The basic purpose of this function is to allow you to concatenate
several function calls together in a single expression without having
to reconcile the different data types that those functions may return.
_Nullify(INKEY(100),"C")
| | |-------The Return Value Type (Char if NIL)
--------
|------------The Embedded Function
_Nullify() nullifies any other function in an in-line expression by
calling that function, and accepting it's return value as it own
first parameter. This function's return value is instead ignored, and
the SECOND parameter to _Nullify() specifies what sort of empty/nil value
to return.
"C" returns '', "N" returns 0
If cRetType is not specified at all (i.e., NIL) then "" is returned
by default. If an invalid (not C or N) is specified, then the return value
is an empty character type ("").
Note that "_X()" is a pseudonym that may be used in place of "_Nullify()",
and "_Nulify()" is an alternate spelling. They perform the same task, but in
places where space is at a premium (ie, in the _KMenu() Menu System where the
menu allows only so many keystrokes in any given field), _X() may save you
some worthy space.
NOTE:
EXAMPLE:
This function does nothing other than allow me to do inline nulification
of other function's return values. This allows me to, say, add a pause into
a dial string:
ATDT1800555-1212 + _Nullify(inkey(3)) + '372* 886#'
It can also allow you to make two function calls in a single expression
(such as, for example, the PREFUNC field in the _KMENU system) (Using the
_X() pseudonym):
_X( 'TONE(1000,3)', "C" )+_Nulify( '_Msg("Wrong Answer!")', "C" )
In this case, a beep will sound, followed by the Message "Wrong Answer", even
though the two functions that did this return different values. The
_Nullify() function returns a "" for each function allowing them to be
combined with the "+" operator.
******************************************************************************/